<div ng-controller="z-role-c" z-loading is-loading="viewModel.isLoading">
	<div viewstack class="carousel slide" data-ride="carousel">
		<div class="carousel-inner" role="listbox">
			<div class="item active">
				<div class="row">
                    <div class="col-lg-12 heading">
                        <ul id="crumb" class="breadcrumb">
	                        <li>
		                        <i class="im-home"></i>
		                        <a href="index.html">首页</a>
	                        </li>
	                        <li ng-repeat="menu in viewModel.menuList">
	                        	<i class="{{menu.icons}}" ng-if="$index+1!=viewModel.menuList.length"></i>
	                        	<i class="en-arrow-right7" ng-if="$index+1==viewModel.menuList.length"></i>
	                        	{{menu.label}}
	                        </li>
                        </ul>
                    </div>
                </div>
              
                <div class="outlet">
	                <div class="panel-body">
	                    <form class="form-horizontal group-border hover-stripped" role="form" name="form">
	                       <div class="row">
	                       		<div class="col-xs-12 col-sm-10 col-md-11 form-box">
									<div class="col-sm-6 col-md-4 col-lg-3 form-item">
										<div class="col-sm-5 col-md-5 form-title">公司：</div>
										<div class="col-sm-7 col-md-7 form-input">
											<div class="input-group" style="width:272%;">
												<select id="rCorporation" multiple="multiple" class="form-control" ng-model="viewModel.corporationList" tabIndex="1">
				                                </select>	   
											</div>
										</div>
									</div>
									<div class="col-sm-6 col-md-4 col-lg-3 form-item">
									</div>
									<div class="col-sm-6 col-md-4 col-lg-3 form-item">
										<div class="col-sm-5 col-md-5 form-title">岗位：</div>
										<div class="col-sm-7 col-md-7 form-input">
											<div class="input-group" ng-class="{ 'has-error' : form.role.$invalid && !form.role.$pristine }">
												<input name="role" 
													   ng-model="viewModel.role" 
													   type="text" 
													   placeholder="岗位名称、岗位编码" 
													   maxLength="60"
													   autofocus="autofocus"
													   class="form-control"
													   tabIndex="2" >
											</div>
										</div>
									</div>
									<div class="col-sm-6 col-md-4 col-lg-3 form-item">
										<div class="col-sm-5 col-md-5 form-title">员工：</div>
										<div class="col-sm-7 col-md-7 form-input">
											<div class="input-group">
												<textarea ng-model="viewModel.employeeNo" placeholder="员工号、中文名称、英文名称" class="form-control elastic __web-inspector-hide-shortcut__" rows="1"></textarea>
											</div>
										</div>
									</div>
								</div>	
								<div class="col-xs-12 col-sm-10 col-md-11 form-box">
									  <div class="col-sm-12 col-md-12 col-lg-12 form-item">
									    <div class="col-sm-6 col-md-4 col-lg-3 form-item">
										  <div class="col-sm-5 col-md-5 form-title">基准日期：</div>
										   <div class="col-sm-7 col-md-7 form-input">
											<div class="input-group" ng-class="{ 'has-error' : editForm.effectiveDate.$dirty && editForm.effectiveDate.$invalid }">
												<input name="effectiveDate" 
													   ng-model="viewModel.effectiveDate" 
													   ng-change="viewModel.dateChange()"
													   class="form-control datetime-picker" 
													   type="text"
													   ng-click="viewModel.effectiveDateOpen($event)"
													   autofocus="autofocus" 
													   maxLength="10"
													   z-datepicker-popup="{{viewModel.format}}"
													   is-open="viewModel.effectiveDateOpnened"
													   datepicker-options="viewModel.dateOptions"
												       close-text="Close"
												       required
												       readonly>
												<span class="input-group-addon cursorPointer" ng-click="viewModel.effectiveDateOpen($event)"><i class="fa-calendar"></i></span>
											</div>
										   </div>
									    </div>
									    <div class="col-sm-3 col-md-4 col-lg-3 form-item">
											<div class="col-lg-1 col-md-1">
												<button type="button" class="btn btn-success" ng-click="viewModel.rowCount=1;viewModel.bindData(1)" tabIndex="3">搜索</button>
				                            </div>
										</div>
									</div>
								</div>
							</div>
	                    </form>
	                </div>
                </div>
                <div class="outlet outbon">
					<button class="btn btn-success" ng-click="viewModel.add()" tabIndex="2">新增</button>
                </div>
				<div class="container-fluid">
					<div class="row">
						<!-- <table class="table table-striped  table-bordered table-hover"> -->
						<table class="table table-striped table-bordered" cellspacing="0" width="100%">
							<thead>
								<tr>
									<th>岗位编码</th>
									<th>岗位名称</th>
									<th>上级岗位</th>
									<th width="6%">岗位级别</th>
									<th>所属部门</th>
									<th>所属公司</th>
									<th>分配人员</th>
									<th width="8%">开始日期</th>
									<th width="%">结束日期</th>
									<th width="14%">操作</th>
								</tr>
							</thead>
							<tbody>
								<tr ng-repeat="role in viewModel.dataList">
									<td>{{role.roleCode}}</td>
									<td>{{role.roleName}}</td>
									<td>
										<span ng-if="role.parentCode!=null">
											({{role.parentCode}}){{role.parentName}}
										</span>
									</td>
									<td>{{role.roleLevelName}}</td>
									<td>
										<span ng-if="role.departmentCode!=null">
											({{role.departmentCode}}){{role.departmentName}}
										</span>
									</td>
									<td>
										<span ng-if="role.corporationCode!=null">
											({{role.corporationCode}}){{role.corporationName}}
										</span>
									</td>
									<td>
										<span ng-repeat="employee in role.employeeBeanList">
											({{employee.employeeNo}}){{employee.chineseName}}
											<span ng-if="role.employeeBeanList.length-1!=$index">,</span>
										</span>
									</td>
									<td>{{role.fromDate | date:'yyyy/MM/dd'}}</td>
									<td>{{role.thruDate | date:'yyyy/MM/dd'}}</td>
									<td>
										<button type="button" class="btn btn-primary btn-sm" ng-click="viewModel.update(role)">修改</button>
										<button type="button" class="btn btn-danger btn-sm" ng-click="viewModel.del(role)">删除</button>
									</td>
								</tr>
							</tbody>
						</table>
					</div>
					<div class="row">
						<div z-Pagination total-Data='viewModel.totalData'
							per-Page='viewModel.perPage'
							current-Page='viewModel.rowCount'
							on-Click="viewModel.bindData()"
							on-Change-Per-Page="viewModel.bindData()"></div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<z-Dialog show-Save-Btn="true" 
		have-Error-Class="false" 
		load-Url="static/html/role/roleEdit.html" 
		title="{{editModel.title}}" 
		show="viewModel.show"
		cancel-fn="viewModel.unLoad()"
		save-fn="viewModel.save()"
		body-Height="320"></z-Dialog>
	<z-Dialog show-Save-Btn="false" 
		have-Error-Class="false" 
		load-Url="static/html/role/selectRole.html" 
		title="{{viewSelectUpRoleModel.title}}" 
		show="viewSelectUpRoleModel.show"
		cancel-fn="viewSelectUpRoleModel.unLoad()"
		body-Height="555"></z-Dialog>
	<z-Dialog show-Save-Btn="false" 
		have-Error-Class="false" 
		load-Url="static/html/role/selectDepartment.html" 
		title="{{viewSelectUpDepartmentModel.title}}" 
		show="viewSelectUpDepartmentModel.show"
		cancel-fn="viewSelectUpDepartmentModel.unLoad()"
		body-Height="555"></z-Dialog>
</div>